<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>网络学生</title>
		<link rel="stylesheet" href="./layui/css/layui.css">
		<script src="./layui/layui.js"></script>
		<script type="text/javascript" src="js/global.js"></script>
		<script type="text/javascript" src="layui/layui_exts/excel.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="lib/layui/lay/modules/table.js"></script>
	</head>

	<body>
		<div class="layui-form-item" style="margin-top: 20px" onsubmit="false">
			<div class="layui-form-item">
				<label class="layui-form-label">学生姓名</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="stuName" id="stuName" lay-verify="required" />
				</div>
				<label class="layui-form-label">联系电话</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="phone" id="phone" lay-verify="required" />
				</div>
				<label class="layui-form-label">咨询师</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="askerName" id="askerName" lay-verify="required" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">是否缴费</label>
				<div class="layui-input-inline">
					<select class="layui-input" id="isPay" lay-verify="required">
						<option value="">---请选择---</option>
						<option value="是">是</option>
						<option value="否">否</option>
					</select>
				</div>
				<label class="layui-form-label">是否有效</label>
				<div class="layui-input-inline">
					<select class="layui-input" id="isValid" lay-verify="required">
						<option value="">---请选择---</option>
						<option value="是">是</option>
						<option value="否">否</option>
					</select>
				</div>
				<label class="layui-form-label">是否分配</label>
				<div class="layui-input-inline">
					<select class="layui-input" id="exOne" lay-verify="required">
						<option value="">---请选择---</option>
						<option value="是">是</option>
						<option value="否">否</option>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">创建时间</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="begincreateTime" id="begincreateTime" lay-verify="required" />
				</div>
				<label class="layui-form-label" style="width: 1px;">~</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="endcreateTime" id="endcreateTime" lay-verify="required" />
				</div>
				<label class="layui-form-label">联系电话</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="phone" id="phone" lay-verify="required" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">上门时间</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="beginhomeTime" id="beginhomeTime" lay-verify="required" />
				</div>
				<label class="layui-form-label" style="width: 1px;">~</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="endhomeTime" id="endhomeTime" lay-verify="required" />
				</div>
				<label class="layui-form-label">QQ</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="qq" id="qq" lay-verify="required" />
				</div>
				<button class="layui-btn" id="serach1" data-type="reload">搜索</button>
			</div>
		</div>
		<div>
			<button type="button" lay-submit="" class="layui-btn " lay-filter="uploadImg"><i class="layui-icon"></i>导出Excel</button>
			<label id="updateall"></label>
		</div>

		<table id="demo" lay-filter="test"></table>
		<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="message">发送消息</a>
			<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
			<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		</script>
		<script type="text/html" id="toolbarDemo">
			<div class="layui-btn-container">
				<button class="layui-btn layui-btn-sm" lay-event="add">添加</button>
			</div>
		</script>
		<script>
			layui.use(['table', 'form', 'laydate'], function() {
				var table = layui.table;
				var $ = layui.jquery; //引入jquery
				var form = layui.form;
				var laydate = layui.laydate;
				//解决跨域
				$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
					options.xhrFields = {
						withCredentials: true
					}
				})
				var cols = [
					[ //表头
						{
							type: 'checkbox',
							fixed: 'left'
						}, {
							field: 'id',
							title: 'ID',
							width: 80,
							sort: true,
							fixed: 'left',
							align: 'center'
						}, {
							field: 'stuName',
							title: '学生姓名',
							width: 100,
							align: 'center'
						}, {
							field: 'age',
							title: '年龄',
							width: 80,
							align: 'center'
						}, {
							field: 'sex',
							title: '性别',
							width: 80,
							align: 'center'
						}, {
							field: 'phone',
							title: '联系电话',
							width: 150,
							align: 'center'
						}
						//	      ,{field: 'stuStatus', title: '学生状态', width:150,align : 'center'}
						, {
							field: 'msgSource',
							title: '来源',
							width: 100,
							align: 'center'
						}, {
							field: 'sourceUrl',
							title: '来源地址',
							width: 120,
							align: 'center'
						}, {
							field: 'address',
							title: '地址',
							width: 180,
							align: 'center'
						}, {
							field: 'netPusherId',
							title: '录入人',
							width: 120,
							align: 'center'
						}, {
							field: 'askerName',
							title: '咨询师',
							width: 120,
							align: 'center'
						} //要连表查询
						, {
							field: 'qq',
							title: 'QQ',
							width: 120,
							align: 'center'
						}, {
							field: 'weiXin',
							title: '微信',
							width: 120,
							align: 'center'
						}, {
							field: 'content',
							title: '对学生备注',
							width: 120,
							align: 'center'
						}, {
							field: 'createTime',
							title: '创建时间',
							width: 180,
							align: 'center'
						}, {
							field: 'learnFoward',
							title: '课程方向',
							width: 120,
							align: 'center'
						}, {
							field: 'isValid',
							title: '是否有效',
							width: 100,
							align: 'center'
						}, {
							field: 'record',
							title: '回访记录',
							width: 120,
							align: 'center'
						}, {
							field: 'isReturnVist',
							title: '是否回访',
							width: 100,
							align: 'center'
						}, {
							field: 'firstVisitTime',
							title: '第一次回访时间',
							width: 180,
							align: 'center'
						}, {
							field: 'isHome',
							title: '是否上门',
							width: 100,
							align: 'center'
						}, {
							field: 'homeTime',
							title: '上门时间',
							width: 180,
							align: 'center'
						}, {
							field: 'lostValid',
							title: '失效',
							width: 80,
							align: 'center'
						}, {
							field: 'isPay',
							title: '是否支付',
							width: 100,
							align: 'center'
						}, {
							field: 'payTime',
							title: '支付时间',
							width: 180,
							align: 'center'
						}, {
							field: 'money',
							title: '支付金额',
							width: 100,
							align: 'center'
						}, {
							field: 'isReturnMoney',
							title: '找回金额',
							width: 100,
							align: 'center'
						}, {
							field: 'isInClass',
							title: '是否进班',
							width: 100,
							align: 'center'
						}, {
							field: 'inClassTime',
							title: '进班时间',
							width: 180,
							align: 'center'
						}, {
							field: 'inClassContent',
							title: '进班备注',
							width: 150,
							align: 'center'
						}, {
							field: 'askerContent',
							title: '咨询师备注',
							width: 150,
							align: 'center'
						}, {
							field: 'isDel',
							title: '是否删除',
							width: 100,
							align: 'center'
						}
						//	      ,{field: 'fromPart', title: '部分', width:120,align : 'center'}
						, {
							field: 'stuContent',
							title: '学生内容',
							width: 150,
							align: 'center'
						}, {
							field: 'isBaoBei',
							title: '是否报备',
							width: 100,
							align: 'center'
						}, {
							field: 'ziXunName',
							title: '咨询姓名',
							width: 100,
							align: 'center'
						}, {
							field: 'returnMoneyReason',
							title: '退款原因',
							width: 120,
							align: 'center'
						}, {
							field: 'preMoney',
							title: '退款金额',
							width: 100,
							align: 'center'
						}, {
							field: 'preMoneyTime',
							title: '退款时间',
							width: 180,
							align: 'center'
						}, {
							field: 'perState',
							title: '退款状态',
							width: 100,
							align: 'center'
						}, {
							field: 'right',
							title: '操作',
							toolbar: '#barDemo',
							align: 'center',
							width: 350
						}
					]
				]
				intCols();

				function intCols() {
					for(var i = 0; i < cols[0].length; i++) {
						if(cols[0][i].field != undefined) {
							let localfield = 'test' + cols[0][i].field;
							let hidevalue = window.localStorage.getItem(localfield);
							if(hidevalue === 'false') {
								cols[0][i].hide = false;
							} else if(hidevalue === 'true') {
								cols[0][i].hide = true;
							}
						}
					}
				}
				//第一个实例
				table.render({
					elem: '#demo',
					toolbar: '#toolbarDemo' //开启头部栏工具
						,
					url: globalData.server + './student/getAllStudetnNet?loginName=' + globalData.getUserName() //数据接口
						,
					page: true //开启分页
						,
					method: 'POST',
					defaultToolbar: ['filter', 'exports', 'print'],
					id: 'idTest',
					cols: cols
				});
				// 选择需要观察变动的节点
				const targetNode = document.getElementsByClassName('layui-table-tool'); //document.getElementById('some-
				const targetNode1 = document.getElementsByClassName('layui-table-tool-self')[0]; //document.getElementById('some-id');
				//  console.log(targetNode);
				//  console.log(targetNode1);
				// 观察器的配置（需要观察什么变动）
				const config = {
					attributes: true,
					childList: true,
					subtree: true
				};

				// 当观察到变动时执行的回调函数
				const callback = function(mutationsList, observer) {
					console.log(mutationsList);
					//  console.log(observer);
					// Use traditional 'for loops' for IE 11
					for(let mutation of mutationsList) {
						if(mutation.type === 'childList') {
							// console.log('A child node has been added or removed');
						} else if(mutation.type === 'attributes') {
							console.log(mutation.target.innerText);
							//先根据innertext 列名称 对cols 进行field 查询,查到field 可以找到本地缓存的字段,约定,本地缓存的命名规则为表名字母缩写_加field名组成,防止冲突
							var field = "";
							for(var i = 0; i < cols[0].length; i++) {
								if(cols[0][i].title === mutation.target.innerText) //标题相同 则取field
								{
									field = cols[0][i].field;
									break;
								}
							}
							if(field !== "") {
								// 组装缓存key
								let localkey = 'test' + field;
								//判断value值
								if(mutation.target.classList[2] != undefined) //说明2: "layui-form-checked"  复选框是已选择的,说明此列是在表中显示的
								{
									window.localStorage.setItem(localkey, false);
								} else //没被选择,说明此列不在table中显示
								{
									window.localStorage.setItem(localkey, true);
								}
							}
						}
					}
				};

				// 创建一个观察器实例并传入回调函数
				const observer = new MutationObserver(callback);
				// 以上述配置开始观察目标节点
				observer.observe(targetNode1, config);
				
				//双击显示学生详情
				table.on('rowDouble(test)',function(obj){
					layer.open({ //打开一个页面
							type: 2, //在当前页面之上以弹框的形式，展示编辑页面
							area: ['500px', '550px'], //页面宽高
							content: 'student-check.html', //页面所在位置
							title: '您正在查看学生编号为' + obj.data.id + '的信息',
							success: function(layero, index) {
								var body = layer.getChildFrame('body', index);
								body.contents().find("#id").val(obj.data.id);
								body.contents().find("#stuName").val(obj.data.stuName);
								body.contents().find("#age").val(obj.data.age);
								body.contents().find("#sex").val(obj.data.sex);
								body.contents().find("#phone").val(obj.data.phone);
								body.contents().find("#msgSource").val(obj.data.msgSource);
								body.contents().find("#sourceUrl").val(obj.data.sourceUrl);
								body.contents().find("#address").val(obj.data.address);
								body.contents().find("#askerName").val(obj.data.askerName);
								body.contents().find("#qq").val(obj.data.qq);
								body.contents().find("#weiXin").val(obj.data.weiXin);
								body.contents().find("#content").val(obj.data.content);
								body.contents().find("#createTime").val(obj.data.createTime);
								body.contents().find("#learnFoward").val(obj.data.learnFoward);
								body.contents().find("#isValid").val(obj.data.isValid);
								body.contents().find("#record").val(obj.data.record);
								body.contents().find("#isReturnVist").val(obj.data.isReturnVist);
								body.contents().find("#firstVisitTime").val(obj.data.firstVisitTime);
								body.contents().find("#isHome").val(obj.data.isHome);
								body.contents().find("#homeTime").val(obj.data.homeTime);
								body.contents().find("#lostValid").val(obj.data.lostValid);
								body.contents().find("#isPay").val(obj.data.isPay);
								body.contents().find("#payTime").val(obj.data.payTime);
								body.contents().find("#money").val(obj.data.money);
								body.contents().find("#isInClass").val(obj.data.isInClass);
								body.contents().find("#inClassTime").val(obj.data.inClassTime);
								body.contents().find("#inClassContent").val(obj.data.inClassContent);
								body.contents().find("#askerContent").val(obj.data.askerContent);
								body.contents().find("#isBaoBei").val(obj.data.isBaoBei);
							},
							end: function() {
								window.location.reload(); //当窗口关闭后刷新页面
							}
						});
				});
				$('#serach1').on('click', function() {
					var stuName = $("#stuName").val(); //上面搜索框的id
					var phone = $("#phone").val(); //上面搜索框的id
					var askerName = $("#askerName").val(); //上面搜索框的id
					var isValid = $("#isValid").val(); //上面搜索框的id
					var isPay = $("#isPay").val(); //上面搜索框的id
					var begincreateTime = $("#begincreateTime").val(); //上面搜索框的id
					var endcreateTime = $("#endcreateTime").val(); //上面搜索框的id
					var exOne = $("#exOne").val(); //上面搜索框的id
					var beginhomeTime = $("#beginhomeTime").val(); //上面搜索框的id
					var endhomeTime = $("#endhomeTime").val(); //上面搜索框的id
					var qq = $("#qq").val(); //上面搜索框的id
					table.reload('idTest', {
						where: { //请求参数
							'stuName': stuName,
							'phone': phone,
							'exOne': exOne,
							'isValid': isValid,
							'isPay': isPay,
							'begincreateTime': begincreateTime,
							'endcreateTime': endcreateTime,
							'beginhomeTime': beginhomeTime,
							'endhomeTime': endhomeTime,
							'qq': qq,
						}
					});
				});

				//监听头部工具栏
				table.on('toolbar(test)', function(obj) {
					switch(obj.event) {
						case 'add':
							layer.open({ //打开一个页面
								type: 2, //在当前页面打开一个页面
								area: ['500px', '550px'], //页面宽高
								content: 'student-add.html', //页面地址
								title: '添加学生', //打开页面标题
								end: function() {
									window.location.reload(); //当窗口关闭后刷新页面
								}
							});
							break;
					};
				});
				//监听工具条
				table.on('tool(test)', function(obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
					var data = obj.data; //获得当前行数据
					if(obj.event === 'del') { //删除
						layer.confirm('真的删除行么', function(index) {
							var url = globalData.server + './student/updateisDelNet'; //请求地址
							$.post(url, {
								id: obj.data.id,
							}, function(data) {
								if(data.count > 0) {
									console.log('删除成功');
									window.location.reload(); //刷新页面
								} else {
									layer.msg(data.msg, {
										icon: 6
									});
								}
							}, "json");
						});
					}else if(obj.event === 'message') { //发送消息
						layer.open({ //打开一个页面
							type: 2, //在当前页面之上以弹框的形式，展示编辑页面
							area: ['500px', '550px'], //页面宽高
							content: 'message-add.html', //页面所在位置
							title: '发送信息',
							success: function(layero, index) {
								var body = layer.getChildFrame('body', index);
								body.contents().find("#stuId").val(obj.data.id); //学生id
								body.contents().find("#askerName").val(obj.data.askerName); //咨询师姓名
								body.contents().find("#receiveId").val(obj.data.askerid); //咨询师id
								body.contents().find("#sentId").val(globalData.getUid()); //发送人id
							},
							end: function() {
								window.location.reload(); //当窗口关闭后刷新页面
							}
						});
					}  else if(obj.event === 'edit') { //编辑
						layer.open({ //打开一个页面
							type: 2, //在当前页面之上以弹框的形式，展示编辑页面
							area: ['500px', '550px'], //页面宽高
							content: 'student-edit-net.html', //页面所在位置
							title: '您正在编辑学生编号为' + obj.data.id + '的信息',
							success: function(layero, index) {
								var body = layer.getChildFrame('body', index);
								body.contents().find("#id").val(obj.data.id);
								body.contents().find("#stuName").val(obj.data.stuName);
								body.contents().find("#phone").val(obj.data.phone);
								body.contents().find("#address").val(obj.data.address);
								body.contents().find("#qq").val(obj.data.qq);
								body.contents().find("#weiXin").val(obj.data.weiXin);
							},
							end: function() {
								window.location.reload(); //当窗口关闭后刷新页面
							}
						});
					}else if(obj.event === 'zhui') { //追踪
						layer.confirm('确定追踪？', function(index) {
							var url = globalData.server + './netFollow/addnetFollowsss'; //请求地址
							$.post(url, {
								studentId: obj.data.id,
								askerId: obj.data.askerid,
							}, function(data) {
								if(data.count > 0) {
									console.log('追踪成功');
									window.location.reload(); //刷新页面
								} else {
									layer.msg(data.msg, {
										icon: 6
									});
								}
							}, "json");
						});
					}
				});
				
				
				//日期时间范围 创建开始时间
				laydate.render({
					elem: '#begincreateTime',
					type: 'datetime'
				});
				//日期时间范围 创建结束时间
				laydate.render({
					elem: '#endcreateTime',
					type: 'datetime'
				});
				//日期时间范围 上门开始时间
				laydate.render({
					elem: '#beginhomeTime',
					type: 'datetime'
				});
				//日期时间范围 上门结束时间
				laydate.render({
					elem: '#endhomeTime',
					type: 'datetime'
				});
				//导出Excel
				form.on('submit(uploadImg)', function(data) {
					loading = layer.load(1, {
						shade: [0.3, '#fff']
					});
					var $ = layui.jquery;
					var excel = layui.excel;
					var checkStatus = table.checkStatus('idTest');
					var ids = [];
					var stuName = $("#stuName").val(); //上面搜索框的id
					var phone = $("#phone").val(); //上面搜索框的id
					var askerName = $("#askerName").val(); //上面搜索框的id
					var isValid = $("#isValid").val(); //上面搜索框的id
					var isPay = $("#isPay").val(); //上面搜索框的id
					var begincreateTime = $("#begincreateTime").val(); //上面搜索框的id
					var endcreateTime = $("#endcreateTime").val(); //上面搜索框的id
					var learnFoward = $("#learnFoward").val(); //上面搜索框的id
					var beginhomeTime = $("#beginhomeTime").val(); //上面搜索框的id
					var endhomeTime = $("#endhomeTime").val(); //上面搜索框的id
					var qq = $("#qq").val(); //上面搜索框的id
					$(checkStatus.data).each(function(i, o) { //o即为表格中一行的数据
						ids.push(o.id);
					});
					if(ids.length < 1) {
						$.ajax({
							url: globalData.server + './student/getAllStudetnNetE?loginName=' + globalData.getUserName(), //数据接口
							dataType: 'json',
							type: 'post',
							data: {
								'stuName': stuName,
								'phone': phone,
								'learnFoward': learnFoward,
								'isValid': isValid,
								'isPay': isPay,
								'begincreateTime': begincreateTime,
								'endcreateTime': endcreateTime,
								'learnFoward': learnFoward,
								'beginhomeTime': beginhomeTime,
								'endhomeTime': endhomeTime,
								'qq': qq,
							},
							success: function(res) {
								layer.close(loading);
								layer.msg(res.msg);
								// 假如返回的 res.data 是需要导出的列表数据
								console.log(res.data); //
								// 1. 数组头部新增表头
								res.data.unshift({
									id: "学生id",
									stuName: "学生姓名",
									age: "年龄",
									sex: "性别",
									phone: "联系电话",
									msgSource: "来源",
									sourceUrl: "来源地址",
									address: "地址",
									netPusherId: "录入人",
									askerid: "咨询师id",
									qq: "QQ",
									weiXin: "微信",
									content: "对学生备注",
									createTime: "创建时间",
									learnFoward: "课程方向",
									isValid: "是否有效",
									record: "回访记录",
									isReturnVist: "是否回访",
									firstVisitTime: "第一次回访时间",
									isHome: "是否上门",
									homeTime: "上门时间",
									lostValid: "失效",
									isPay: "是否缴费",
									payTime: "支付时间",
									money: "支付金额",
									isReturnMoney: "找回金额",
									isInClass: "是否进班",
									inClassTime: "进班时间",
									inClassContent: "进班备注",
									askerContent: "咨询师备注",
									isDel: "是否删除",
									stuContent: "学生内容",
									isBaoBei: "是否报备",
									ziXunName: "咨询姓名",
									returnMoneyReason: "退款原因",
									preMoney: "退款金额",
									preMoneyTime: "退款时间",
									perState: "退款状态",
									askerId: '咨询师id',
									askerName: '咨询师姓名',
									checkState: '咨询师状态',
									checkInTime: "签到时间",
									checkOutTime: '签退时间',
									weight: "权重"
								});
								// 3. 执行导出函数，系统会弹出弹框
								excel.exportExcel({
									sheet1: res.data
								}, '学生信息表.xlsx', 'xlsx');
							},
							error: function(res) {
								layer.close(loading);
								layer.msg("请求错误");
							}

						});
						globalData.loginOutIds();

					} else {
						$.ajax({
							url: globalData.server + './student/getAllStudetnNetExcel?loginName=' + globalData.getUserName(), //数据接口
							dataType: 'json',
							type: 'post',
							data: {
								'ids': ids.join(","),
								//              datas:JSON.stringify(data.field) //ids.join(","),
							},
							success: function(res) {
								layer.close(loading);
								layer.msg(res.msg);
								// 假如返回的 res.data 是需要导出的列表数据
								console.log(res.data); //
								// 1. 数组头部新增表头
								res.data.unshift({
									id: "学生id",
									stuName: "学生姓名",
									age: "年龄",
									sex: "性别",
									phone: "联系电话",
									msgSource: "来源",
									sourceUrl: "来源地址",
									address: "地址",
									netPusherId: "录入人",
									askerid: "咨询师id",
									qq: "QQ",
									weiXin: "微信",
									content: "对学生备注",
									createTime: "创建时间",
									learnFoward: "课程方向",
									isValid: "是否有效",
									record: "回访记录",
									isReturnVist: "是否回访",
									firstVisitTime: "第一次回访时间",
									isHome: "是否上门",
									homeTime: "上门时间",
									lostValid: "失效",
									isPay: "是否缴费",
									payTime: "支付时间",
									money: "支付金额",
									isReturnMoney: "找回金额",
									isInClass: "是否进班",
									inClassTime: "进班时间",
									inClassContent: "进班备注",
									askerContent: "咨询师备注",
									isDel: "是否删除",
									stuContent: "学生内容",
									isBaoBei: "是否报备",
									ziXunName: "咨询姓名",
									returnMoneyReason: "退款原因",
									preMoney: "退款金额",
									preMoneyTime: "退款时间",
									perState: "退款状态",
									askerId: '咨询师id',
									askerName: '咨询师姓名',
									checkState: '咨询师状态',
									checkInTime: "签到时间",
									checkOutTime: '签退时间',
									weight: "权重"
								});
								// 3. 执行导出函数，系统会弹出弹框
								excel.exportExcel({
									sheet1: res.data
								}, '学生信息表.xlsx', 'xlsx');
							},
							error: function(res) {
								layer.close(loading);
								layer.msg("请求错误");
							}

						});
						globalData.loginOutIds();
					}
				});
				//根据角色名称去查询是否给显示批量修改咨询师按钮
				$(function() {
					$.ajax({
						type: "post",
						url: globalData.server + "./student/getLoginName?loginName=" + globalData.getUserName(), //据登录名查询是否该签到
						dataType: "json",
						success: function(data1) { //再去判断是否已经签到
							if(data1.count > 0) { //>0是咨询师 追加
								$("#updateall").append('<button type="button" lay-submit="" class="layui-btn layui-btn-warm" id="updateall">批量修改咨询师</button>');
							}
						}

					});
				});
				//  追踪学生
				$('#zhuizong').click(function() {
					var checkStatus = table.checkStatus('idTest');
					var ids = [];
					$(checkStatus.data).each(function(i, o) { //o即为表格中一行的数据
						ids.push(o.id);
					});
					if(ids.length < 1) {
						layer.msg('无选中项');
						return false;
					}
					ids = JSON.stringify(ids);
					//保存相关数据到本地数据库
					globalData.setIdsInfo(ids);
					layer.open({ //打开一个页面
						type: 2, //在当前页面打开一个页面
						area: ['500px', '550px'], //页面宽高
						content: 'follow-check.html', //页面地址
						title: '追踪学生', //打开页面标题
						end: function() {
							window.location.reload(); //当窗口关闭后刷新页面
						}
					});

				});
				//批量修改咨询师
				$("#updateall").click(function() {
					var checkStatus = table.checkStatus('idTest');
					var ids = [];
					$(checkStatus.data).each(function(i, o) { //o即为表格中一行的数据
						ids.push(o.id);
					});
					if(ids.length < 1) {
						layer.msg('无选中项');
						return false;
					}
					ids = JSON.stringify(ids);
					//保存相关数据到本地数据库
					globalData.setIdsInfo(ids);
					layer.open({ //打开一个页面
						type: 2, //在当前页面打开一个页面
						area: ['500px', '550px'], //页面宽高
						content: 'student-edit-asker.html', //页面地址
						title: '修改学生的咨询师', //打开页面标题
						end: function() {
							window.location.reload(); //当窗口关闭后刷新页面
						}
					});
				});

			});
		</script>
	</body>

</html>